#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>

#define FOR(i,a,n) for(int i=a,_n(n);i<_n;++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

typedef pair<int,int> pii;
#define dist first
#define id second

int f[12];
int dist[][9]=
{
    {0,1,2,1,2,3,2,3,4},
    {1,0,1,2,1,2,3,2,3},
    {2,1,0,3,2,1,4,3,2},
    {1,2,3,0,1,2,1,2,3},
    {2,1,2,1,0,1,2,1,2},
    {3,2,1,2,1,0,3,2,1},
    {2,3,4,1,2,3,0,1,2},
    {3,2,3,2,1,2,1,0,1},
    {4,3,2,3,2,1,2,1,0},
};
bool CanSlove(char* st)
{
    int cnt = 0;
    REP(i,9) REP(j,i)
    {
        if(st[j]>st[i]&&st[j]!=9) cnt++;
    }
    return cnt&1^1;
}
int StringToId(char* st)
{
    int ans = 0;
    REP(i,9)
    {
        int cnt = 0;
        REP(j,i) if(st[j]<st[i]) cnt++;
        ans += (st[i]-1-cnt)*f[8-i];
    }
    return ans;
}
void IdToString(int id,char *ans,int len=9)
{
    bool done[10];
    REP(i,10) done[i] = false;
    REP(i,len)
    {
        int t = id/f[len-1-i];
        int cnt = 0,pos;
        REP(j,9) if(!done[j])
        {
            pos = j;
            if(++cnt==t+1) break;
        }
        ans[i]=pos+1;
        done[pos] = true;
        id%=f[len-1-i];
    }
    return ;
}
int GetDist(char* st)
{
    int sum = 0;
    REP(i,9) sum+=dist[st[i]-1][i];
    return sum-2;
}
void init()
{
    f[0] = 1;
    FOR(i,1,10) f[i] = f[i-1]*i;
}
char dir[400000];
vector<char> ans;
bool IDA_star(int vs,int dep,int tt)
{
    if(vs==tt)
    {
        ans.push_back(dir[vs]);
        return true;
    }
    char now[10];
    char t[10];
    IdToString(vs,now);
    if(GetDist(now)>dep) return false;
    int pos = 0;
    REP(i,9) if(now[i]==9)
    {
        pos = i;
        break;
    }
    if(pos%3!=2)
    {
        memcpy(t,now,sizeof(t));
        swap(t[pos],t[pos+1]);
        int id = StringToId(t);
        if(dir[id]==-1||dir[id]=='r')
        {
            dir[id] = 'r';
            if(IDA_star(id,dep-1,tt))
            {
                ans.push_back(dir[vs]);
                return true;
            }
        }
    }
    if(pos<6)
    {
        memcpy(t,now,sizeof(t));
        swap(t[pos],t[pos+3]);
        int id = StringToId(t);
        if(dir[id]==-1||dir[id]=='d')
        {
            dir[id] = 'd';
            if(IDA_star(id,dep-1,tt))
            {
                ans.push_back(dir[vs]);
                return true;
            }
        }
    }
    if(pos%3>0)
    {
        memcpy(t,now,sizeof(t));
        swap(t[pos],t[pos-1]);
        int id = StringToId(t);
        if(dir[id]==-1||dir[id]=='l')
        {
            dir[id] = 'l';
            if(IDA_star(id,dep-1,tt))
            {
                ans.push_back(dir[vs]);
                return true;
            }
        }
    }
    if(pos>2)
    {
        memcpy(t,now,sizeof(t));
        swap(t[pos],t[pos-3]);
        int id = StringToId(t);
        if(dir[id]==-1||dir[id]=='u')
        {
            dir[id] = 'u';
            if(IDA_star(id,dep-1,tt))
            {
                ans.push_back(dir[vs]);
                return true;
            }
        }
    }
    return false;
}

int main()
{
    init();
    int n = 9;
    char s[10];
    while(true)
    {
        REP(i,9) if(scanf("%s",s+i)==EOF) return 0;
        REP(i,9)
        if(s[i]=='x') s[i] = 9;
        else s[i]-='0';
        if(!CanSlove(s))
        {
            puts("unsolvable");
        }
        else
        {
            ans.clear();
            fill(dir,dir+400000,-1);
            dir[StringToId(s)] = 0;
            FOR(dep,GetDist(s)+5,40000)
            {
                if(IDA_star(StringToId(s),dep,0)) break;
                dep+=4;
            }
            for(int i=ans.size()-2;i>=0;--i) putchar(ans[i]);
            cout<<endl;
        }
    }
    return 0;
}
